home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_361 / xcolor-lib / demo_sources / c_demo.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  1KB  |  47 lines

  1. /*
  2.     C-Demo for XColor-Library
  3.  
  4.     © by Roger Fischlin,
  5.     created 24.1.90 by Ølli
  6.  
  7.     for Lettuce-C V5.04
  8.  
  9.     calls the color-request for current screen
  10.  
  11. */
  12.  
  13. #include <exec/types.h>
  14. #include <proto/xcolor.h>
  15. #include <proto/exec.h>
  16. #include <intuition/intuitionbase.h>
  17.  
  18. struct IntuitionBase *IntuitionBase;
  19. struct ColorRequest creq;
  20.  
  21. int _main(void);
  22. int _main()
  23. {
  24.     /* open library */
  25.     XColorBase=(struct XColorBase*)OpenLibrary("xcolor.library",XC_VERSION);
  26.     if(!XColorBase) return(20);
  27.     /* find current screen */
  28.     IntuitionBase=XColorBase->XCb_IntuitionBase;
  29.     creq.Screen=IntuitionBase->ActiveScreen;
  30.     if(!creq.Screen) return(20);
  31.     /* fill in requester struct */
  32.     creq.TextColor=2;
  33.     creq.BackColor=1;
  34.     creq.GBorderColor=3;
  35.     creq.GTextColor=0;
  36.     creq.TopEdge=20;
  37.     creq.LeftEdge=120;
  38.     creq.ScreenTitle="Just a test...";
  39.     creq.DefaultWTitle="...for the creq!";
  40.     /* do the request */
  41.     ColorRequester(&creq);
  42.     /* and exit */
  43.     CloseLibrary((struct Library*)XColorBase);
  44.     return(0);
  45. }
  46.  
  47.